/*
 * @Author: CPS
 * @Date: 2020-07-14 11:52:19
 * @Last Modified by: CPS
 * @Last Modified time: 2020-07-30 12:27:46
 * @Projectname Electron-YYS
 * @Filename sonWindows.js
 */
'use strict'
console.log('loading sonWindows.js')
let sonWindow

function create(parent, options) {
  let defaultOptions = {
    parent: parent,
  }

  Object.assign(defaultOptions, options)

  sonWindow = new BrowserWindow(options)

  sonWindow.loadFile(options.template)

  sonWindow
    .once('ready-to-show', () => {
      sonWindow.showInactive() //显示但不聚焦
    })
    .on('closed', () => {
      sonWindow = null
    })
}

function close() {
  if (sonWindow) {

  }
}

module.exports = (parent, options) => {

}